package com.handu.luna.core.domain.promotion;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.NoRepositoryBean;


/**
 * Created by wangzailiang on 2014/6/25.
 */
@NoRepositoryBean
public interface BonusPromotionRepository<T extends BonusPromotion> extends PromotionRepository<T>{

    @Modifying
    @Query("update #{#entityName} c set c.grantNum = ?1 where c.id = ?2")
    public void updateGrantNum(Long grantNum,Long bonusPromotionId);

    @Modifying
    @Query("update #{#entityName} c set c.usedNum = ?1 where c.id = ?2")
    public void updateUsedNum(Long usedNum,Long bonusPromotionId);



}
